package demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-05-27
 * Time: 16:28
 */
class MyThread implements Runnable {
    public void run() {
        for (int i = 0; i < 3; i++) {
            System.out.println(Thread.currentThread().getName() + "运行，i=" + i);
        }
    }
}
public class CurrentThreadDemo {
    public static void main(String[] args) {
        MyThread my =new MyThread();
        new Thread (my, "线程").start();
        my.run();
    }
}
